package com.clps.mapper;

import com.clps.dto.BankcardDto;
import com.clps.entity.Bankcard;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author ywl
 * @since 2022-09-08
 */
@Repository
public interface BankcardMapper extends BaseMapper<Bankcard> {

    /**
     * 根据卡号获取银行卡信息和用户信息
     * @param cardNumber
     * @return
     */
    BankcardDto getBankCardWithUserInfo(@Param("cardNumber") String cardNumber);

    /**
     * 获取当前用户所有的银行卡号
     * @return
     */
    @Select("select card_number from bankcard")
    List<String> getAllCardNumber();
}
